import request from '@/utils/request'

// api地址
const api = {
  image: 'captcha/image',
  sendSmsCaptcha: 'captcha/sendSmsCaptcha'
}

// 图形验证码
export function image(data) {
  return new Promise((resolve, reject) => {
    request({
      url: '/api/captcha/image',
      method: 'get',
      data,
	   load: false 
    }).then(data => {
      resolve(data)
    }).catch((e) => {
  		console.log(e);
      reject(e)
    })
  })
}
// 发送短信验证码
export function sendSmsCaptcha(data) {
  return new Promise((resolve, reject) => {
    request({
      url: '/api/captcha/sendSmsCaptcha',
      method: 'post',
      data,
	   load: false 
    }).then(data => {
      resolve(data)
    }).catch((e) => {
  		console.log(e);
      reject(e)
    })
  })
}

